<template>
  <div class="right-mian">
    <div class="right-mian-title">
      <!-- <div><img src="../../../assets/home/ceshi1.jpg" class="right-img" /></div>
      <span style="fontweight: 900">本周主审律师</span> -->
      <el-carousel @change="changeCarousel" height="200px">
        <el-carousel-item v-for="(item, index) in carlselList" :key="index">
          <div class="right-div-img">
            <img :src="item.img_url" class="right-img1" />
          </div>
        </el-carousel-item>
      </el-carousel>
      <span
        style="fontweight: 900"
        v-for="(item, index) in carlselList"
        :key="index"
        >{{ index == carlselIndex ? item.user_name : "" }}</span
      >
      <div class="rigt-div-span">
        <span style="fontweight: 900">本周主审律师</span>
      </div>
    </div>
    <ul class="right-mian-mian">
      <div class="right-mian-mian-title">各地劳动法归速递</div>
      <li
        class="right-mian-mian-text"
        v-for="(item, index) in labourLawList"
        :key="index"
        style="list-style: disc"
      >
      {{ item.title }}
      </li>
    </ul>
    <div class="right-mian-title img-ma">
      <div><img src="../../../assets/home/img_ma.png" class="right-img" /></div>
      <span style="fontweight: 900">添加您的咨询顾问</span>
    </div>
    <ul class="right-mian-mian">
      <div class="right-mian-mian-title">产品功能升级</div>
      <li class="right-mian-mian-name" v-for="item,index in upgrade" :key='index'>
        <div><img src="../../../assets/home/ceshi.png" /></div>
        <ul>
          <li class="right-mian-mian-name-top">{{item.title}}</li>
          <li class="right-mian-mian-name-t">{{item.add_time}}</li>
        </ul>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      carlselList: [], //轮播图数据
      carlselIndex: "", //轮播图下表
      labourLawList: [], //劳动法数据
      upgrade: [],
    };
  },
  mounted() {
    this.getRightData()
  },
  methods: {
    //获取初始化数据
    getRightData() {
      // 轮播图律师数据
      this.$api.getLawyer().then((res) => {
        // if(res.code == 20000){
          this.carlselList = res
        // }
      });
      // 劳动法数据
      this.$api.getLaborLaw().then((res) => {
          this.labourLawList = res
      });
      // 产品升级数据
      this.$api.getUpgradeInfoList().then((res) => {
          this.upgrade = res
      });
    },
    //轮播图改变
    changeCarousel(e) {
      this.carlselIndex = e;
    },
  },
};
</script>

<style scoped>
.el-carousel__item h3 {
  /* color: #475669; */
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}
</style>